

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

  <%@page import="java.sql.*" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
   
    <body bgcolor="white"   text="black">
    <img src="course portal1.jpg" width="1400" height="120" alt="course portal1"/>

        <script>
          function validity()
          {
              var valid=false;
              var title=document.facultyupmaterial.title.value;
              var description=document.facultyupmaterial.description.value;
             var title_re=new RegExp("[A-Z|a-z|\\d|_|.]");
             var description_re=new RegExp("[A-Z|a-z|\\d|_|.]");
             if(title.match(title_re))
                  {
                      
                  if(description.match(description_re))
                             {
                                 
                          valid=true;
                                  }
                                  else
                                      {
                                          alert("enter description");
                                          }
                                          }
                                          else
                                              {
                                                  alert("enter title");
                                                  }
                                                  
                                                             return valid;
            }
            
            
    </script>
                                                                                                                           
                                                                                                                                                
<center><i><u><font size="17">upload material</font></u></i></center>
 
 <table>
     <tr>
         <td>
             <table border="4"  cellspacing="7" cellpadding="7">
<thead>

</thead>
<tbody>
<tr>
    <td><a href="viewall.jsp">VIEWCOURSES</a></td>

</tr>
<tr>
    <td><a href="facultydiscussionforum.jsp">DISCUSSIONFORUM</a></td>

</tr>
<tr>
    <td><a href="facultyuploadmaterial.jsp">UPLOADMATERIAL</a></td>

</tr>
<tr>
    <td><a href="facultyuploadassignment.jsp">UPLOAD ASSIGNMENT</a></td>

</tr>

<tr>
    <td><a href="facultyviewmaterial.jsp">VIEWMATERIAL</a></td>
</tr>
<tr>
    <td><a href="facultyviewassignment.jsp">VIEWASSIGNMENT</a></td>
</tr>
<tr>
<td><a href="home.jsp">SIGNOUT</a></td>
</tr>
</tbody>
${msg}
</table></td>
<td width="800">

<form action="facultyuploadmaterial1.jsp" method="POST" name="facultyupmaterial" onsubmit="return validity()" enctype="multipart/form-data">

  <table border="0" align="center" width="40%">

<tbody>
<tr>
<td>Select courseid:</td>
<td>
    <select name="courseid">
    <%
    Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","system");
Statement st=con.createStatement();
//String username=(String)session.getAttribute("username");
ResultSet rs=st.executeQuery("select courseid  from course1");

while(rs.next())
    {
    %>
    <option value=<%=rs.getInt("courseid")%>><%=rs.getInt("courseid")%></option>
    <%
    }
    %>
</select></td>
</tr>
<tr>
    <td>Title</td>
    <td><input type="text" name="title" value="${u.title}" /></td>
</tr>
<tr>
    <td>Description</td>
    <td><textarea name="description" rows="4" cols="20"value="${u.description}">
</textarea></td>
</tr>
<tr>
<td>uploadmaterial:</td>
<td><input type="file" name="BROWSE" value="" /></td>
</tr>
</tbody>
</table>
<center>
<input type="submit" value="submit" />
<input type="reset" value="reset" />
</center>
</form>
</td>
</tr>
</table>
  </body>
</html>

